<%--
  支付机构,商户侧日结平衡表
  User: 蒯越
  Date: 2017/2/22
  Time: 14:51
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../common/taglibs.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>支付机构,商户侧日结平衡表</title>
    <script src="${ctx}/js/views/common/big.min.js"></script>
    <script src="${ctx}/js/views/report/busiDayBalanceReport.js"></script>
    <link rel="stylesheet" href="${ctx}/css/common.css">
    <link rel="stylesheet" href="${ctx}/css/Report.css" media="print" id="c_or">
    <style type="text/css" >
        .printdiv {-webkit-text-size-adjust:none;-webkit-transform: scale(0.85); margin-left: -150px;margin-right: -150px;margin-top: -40px;}
        .printdiv table {font-size:9px;border:1px solid #dedede; border-collapse:collapse;}
        .printdiv table  tr th{
            -webkit-text-size-adjust:none;
            border-width: 1px;
            padding: 2px;
            border-style: solid;
            border-color: #000;
            font-size: 9px;
            font-family: 宋体;

        }
        .printdiv table  tr td{
            -webkit-text-size-adjust:none;
            border-width: 1px;
            padding: 2px;
            border-style: solid;
            border-color: #000;
            font-size: 9px;
            text-align: center;
        }
        .input-xtd{
            width: 150px;
        }
        .input-time{
            width: 80px;
        }
        .title{font-size: 14px;font-weight: 500;margin-bottom: -20px;}
        .input-sss{
            width: 98%;
        }
        .input-std{
            width: 70px;
        }

    </style>
</head>
<body ng-app="myApp" style="overflow:scroll;overflow-x:hidden">
<input style="display: none" id="report" value="${ctx}/css/Report.css"/>
<input style="display: none" id="reportIE" value="${ctx}/css/ReportIE.css"/>
<script src="${ctx}/js/views/report/jquery.jqprint-0.3.js"></script>
<core:import url="../common/pageHead.jsp">
    <core:param name="title" value="亿付数字支付机构、商户侧日结平衡表"/>
</core:import>
<div ng-controller="queryCtrl" class="container-fluid">
    <form id="queryForm" name="queryForm" action="${ctx}/report/dayBalanceReport/search"
          novalidate w5c-form-validate="vm.validateOptions">
        <table class="table table-bordered table-condensed">
            <tr>
                <td class="text-right">
                    <span class="glyphicon glyphicon-calendar">清算日期</span>
                </td>
                <td>
                    <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup
                           ng-model="vm.queryBean.oDate" required/>
                </td>
            </tr>
            <tr align="center">
                <td colspan="6">
                    <button type="button" ng-click="vm.queryDetail()" class="btn btn-default"
                            ng-disabled="queryForm.$invalid">
                        查询
                    </button>
                    <button type="button" ng-click="vm.resetForm()" class="btn btn-default">重置</button>
                    <button type="button" down-file="${ctx}/report/busiDayBalanceReport" params="vm.queryBean"
                            down-file-type="xls" class="btn btn-default" down-cfg="vm.downCfg">
                        下载
                    </button>
                </td>
            </tr>
        </table>
    </form>
    <div>
        <input value="${ctx}/report/dayBalanceReport/printSh" style="display: none" id="print"/>
        <shiro:hasPermission name="dayBalanceReport_create">
            <button ng-click="vm.create()" class="btn btn-default">生成</button>
        </shiro:hasPermission>

        <button ng-click="vm.print()" class="btn btn-default">打印</button>

        <shiro:hasPermission name="dayBalanceReport_busiHandle">
            <button ng-click="vm.busiHandle(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                        ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].reportNo != null && vm.pagination.list[0].dayBalanceReportDataList[0].busiHandler == null"
                    class="btn btn-default">经办</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="dayBalanceReport_busiAuditPass">
            <button ng-click="vm.busiAuditPass(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].busiHandler != null && vm.pagination.list[0].dayBalanceReportDataList[0].busiAuditor == null"
                    class="btn btn-default">审核通过</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="dayBalanceReport_busiAuditNoPass">
            <button ng-click="vm.busiAuditNoPass(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].busiHandler != null && vm.pagination.list[0].dayBalanceReportDataList[0].busiAuditor == null"
                    class="btn btn-default">审核不通过</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="dayBalanceReport_auditRollBack">
            <button ng-click="vm.auditRollBack(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].busiHandler != null"
                    class="btn btn-default">审核回退</button>
        </shiro:hasPermission>
        <shiro:hasPermission name="dayBalanceReport_tasterMchnt">
            <button ng-click="vm.tasterMchnt(vm.pagination.list[0].dayBalanceReportDataList[0].reportNo)"
                    ng-if="vm.pagination.list[0].dayBalanceReportDataList[0].busiAuditor != null && vm.pagination.list[0].dayBalanceReportDataList[0].tasterMchnt == null"
                    class="btn btn-default">审阅</button>
        </shiro:hasPermission>
        <div>
            填表日期：{{vm.pagination.list[0].dayBalanceReportDataList[0].createdTime | date:"yyyy-MM-dd"}}
        </div>

        <table table-detail>
            <thead>
            <tr>
                <th rowspan="2" colspan="4">1、支付机构侧日结数据（T日处理数据）</th>
                <th rowspan="2" colspan="3">2、商户侧T日应计数据</th>
                <th colspan="13">3、商户侧T日销账明细</th>
            </tr>
            <tr>
                <th colspan="2">T日销账成功（1）</th>
                <th colspan="2">T-N日支付未销，T日销账成功（2）</th>
                <th colspan="2">T+N日支付，T日销账A</th>
                <th colspan="2">T日待销账（3）</th>
                <th colspan="2">T日支付，T-N日已销账B</th>
                <th colspan="2">T-N日支付未销，T日退款（4）</th>
                <th>操作</th>
            </tr>
            <tr>
                <th>机构清算日期</th>
                <th>支付机构名称</th>
                <th>笔数</th>
                <th>金额（应收款项）</th>
                <th>商户名称</th>
                <th>笔数</th>
                <th>金额</th>
                <th>总笔数</th>
                <th>总金额</th>
                <th>笔数</th>
                <th>金额</th>
                <th>笔数</th>
                <th>金额</th>
                <th>笔数</th>
                <th>金额</th>
                <th>笔数</th>
                <th>金额</th>
                <th>笔数</th>
                <th>金额</th>
                <th></th>
            </tr>
            </thead>
            <tbody ng-repeat="bean in vm.pagination.list">
            <tr my-color="dayBalanceReportData.red" my-color-true="true" my-color-code="f08080" my-color-type="font"
                ng-repeat="dayBalanceReportData in bean.dayBalanceReportDataList">
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.settleDate | date:"yyyy-MM-dd"}}</td>
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{vm.cached.COMANY_CODE[dayBalanceReportData.payOrgCode]}}</td>
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.bankTransCountD + dayBalanceReportData.bankTransCountC}}</td>
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">
                    {{(dayBalanceReportData.bankTransAmtD - dayBalanceReportData.bankTransAmtC) / 100 | currency:""}}
                </td>
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{vm.cached.MERCHANT_CODE[dayBalanceReportData.mchntCode]}}</td>
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.correspondOrgCountC + dayBalanceReportData.correspondOrgCountD}}</td>
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{(dayBalanceReportData.correspondOrgAmtC - dayBalanceReportData.correspondOrgAmtD) / 100 | currency:""}}</td>
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.mchntTransCountC + dayBalanceReportData.mchntTransCountD}}</td>
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.mchntTransAmtC / 100 | currency:""}}</td>

                <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.dateNotMatchCount}}</td>
                <td ng-show="dayBalanceReportData.show == true" class="input-std">
                    <input ng-model="dayBalanceReportData.dateNotMatchCount" type="number" step="0" class="input-sss" />
                </td>
                <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.dateNotMatchAmt / 100 | currency:""}}</td>
                <td ng-show="dayBalanceReportData.show == true" class="input-std">
                    <input ng-model="dayBalanceReportData.dateNotMatchAmt" type="number" step="0.01" class="input-sss" />
                </td>
                <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.mchntLaterCount}}</td>
                <td ng-show="dayBalanceReportData.show == true" class="input-std">
                    <input ng-model="dayBalanceReportData.mchntLaterCount" type="number" step="0" class="input-sss" />
                </td>
                <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.mchntLaterAmt / 100 | currency:""}}</td>
                <td ng-show="dayBalanceReportData.show == true" class="input-std">
                    <input ng-model="dayBalanceReportData.mchntLaterAmt" type="number" step="0.01" class="input-sss" />
                </td>
                <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.payMoreCount}}</td>
                <td ng-show="dayBalanceReportData.show == true" class="input-std">
                    <input ng-model="dayBalanceReportData.payMoreCount" type="number" step="0" class="input-sss" />
                </td>
                <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.payMoreAmt / 100 | currency:""}}</td>
                <td ng-show="dayBalanceReportData.show == true" class="input-std">
                    <input ng-model="dayBalanceReportData.payMoreAmt" type="number" step="0.01" class="input-sss" />
                </td>
                <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.payBeforeCount}}</td>
                <td ng-show="dayBalanceReportData.show == true" class="input-std">
                    <input ng-model="dayBalanceReportData.payBeforeCount" type="number" step="0" class="input-sss" />
                </td>
                <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.payBeforeAmt / 100 | currency:""}}</td>
                <td ng-show="dayBalanceReportData.show == true" class="input-std">
                    <input ng-model="dayBalanceReportData.payBeforeAmt" type="number" step="0.01" class="input-sss" />
                </td>
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.correspondOrgCountD}}</td>
                <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.correspondOrgAmtD / 100 | currency:""}}</td>
                <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">
                    <shiro:hasPermission name="dayBalanceReport_mchntUpdate">
                        <button ng-click="vm.mchntUpdate(dayBalanceReportData)"
                                ng-if="dayBalanceReportData.reportNo != null && dayBalanceReportData.busiHandler == null"
                                class="btn btn-default">修改</button>
                    </shiro:hasPermission>
                </td>
                <td ng-show="dayBalanceReportData.show == true" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">
                    <shiro:hasPermission name="dayBalanceReport_mchntUpdate">
                        <button ng-click="vm.mchntUpdate(dayBalanceReportData)"
                                ng-if="dayBalanceReportData.reportNo != null && dayBalanceReportData.busiHandler == null"
                                class="btn btn-default">保存</button>
                    </shiro:hasPermission>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr style="text-align: center"
                my-color="vm.sumObject.red" my-color-true="true" my-color-code="f08080" my-color-type="font">
                <td></td>
                <td>合计</td>
                <td>{{vm.sumObject.bankTransCountD + vm.sumObject.bankTransCountC}}</td>
                <td>{{(vm.sumObject.bankTransAmtD - vm.sumObject.bankTransAmtC) / 100 | currency:""}}</td>
                <td>合计</td>
                <td>{{vm.sumObject.correspondOrgCountC + vm.sumObject.correspondOrgCountD}}</td>
                <td>{{(vm.sumObject.correspondOrgAmtC - vm.sumObject.correspondOrgAmtD) / 100 | currency:""}}</td>
                <td>{{vm.sumObject.mchntTransCountC + vm.sumObject.mchntTransCountD}}</td>
                <td>{{(vm.sumObject.mchntTransAmtC - vm.sumObject.mchntTransAmtD) / 100 | currency:""}}</td>
                <td>{{vm.sumObject.dateNotMatchCount}}</td>
                <td>{{vm.sumObject.dateNotMatchAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.mchntLaterCount}}</td>
                <td>{{vm.sumObject.mchntLaterAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.payMoreCount}}</td>
                <td>{{vm.sumObject.payMoreAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.payBeforeCount}}</td>
                <td>{{vm.sumObject.payBeforeAmt / 100 | currency:""}}</td>
                <td>{{vm.sumObject.correspondOrgCountD}}</td>
                <td>{{vm.sumObject.correspondOrgAmtD / 100 | currency:""}}</td>
            </tr>
            </tfoot>
        </table>

        <div>
            经办：{{vm.pagination.list[0].dayBalanceReportDataList[0].busiHandler}}<br/>复核：{{vm.pagination.list[0].dayBalanceReportDataList[0].busiAuditor}}
            <br/>主管：{{vm.pagination.list[0].dayBalanceReportDataList[0].tasterMchnt}}
        </div>


                    <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.dateNotMatchCount}}</td>

                    <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.dateNotMatchAmt / 100 | currency:""}}</td>

                    <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.mchntLaterCount}}</td>

                    <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.mchntLaterAmt / 100 | currency:""}}</td>

                    <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.payMoreCount}}</td>

                    <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.payMoreAmt / 100 | currency:""}}</td>

                    <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.payBeforeCount}}</td>

                    <td ng-show="dayBalanceReportData.show == false" ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.payBeforeAmt / 100 | currency:""}}</td>

                    <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.correspondOrgCountD}}</td>
                    <td ng-if="dayBalanceReportData.payOrgCode != null || dayBalanceReportData.mchntCode != null">{{dayBalanceReportData.correspondOrgAmtD / 100 | currency:""}}</td>

                </tr>
                <%--////////--%>

                <%--////////--%>
                </tbody>

                <tr style="text-align: center"
                    my-color="vm.sumObject.red" my-color-true="true" my-color-code="f08080" my-color-type="font">
                    <td></td>
                    <td>合计</td>
                    <td>{{vm.sumObject.bankTransCountD + vm.sumObject.bankTransCountC}}</td>
                    <td>{{(vm.sumObject.bankTransAmtD - vm.sumObject.bankTransAmtC) / 100 | currency:""}}</td>
                    <td>合计</td>
                    <td>{{vm.sumObject.correspondOrgCountC + vm.sumObject.correspondOrgCountD}}</td>
                    <td>{{(vm.sumObject.correspondOrgAmtC - vm.sumObject.correspondOrgAmtD) / 100 | currency:""}}</td>
                    <td>{{vm.sumObject.mchntTransCountC + vm.sumObject.mchntTransCountD}}</td>
                    <td>{{(vm.sumObject.mchntTransAmtC - vm.sumObject.mchntTransAmtD) / 100 | currency:""}}</td>
                    <td>{{vm.sumObject.dateNotMatchCount}}</td>
                    <td>{{vm.sumObject.dateNotMatchAmt / 100 | currency:""}}</td>
                    <td>{{vm.sumObject.mchntLaterCount}}</td>
                    <td>{{vm.sumObject.mchntLaterAmt / 100 | currency:""}}</td>
                    <td>{{vm.sumObject.payMoreCount}}</td>
                    <td>{{vm.sumObject.payMoreAmt / 100 | currency:""}}</td>
                    <td>{{vm.sumObject.payBeforeCount}}</td>
                    <td>{{vm.sumObject.payBeforeAmt / 100 | currency:""}}</td>
                    <td>{{vm.sumObject.correspondOrgCountD}}</td>
                    <td>{{vm.sumObject.correspondOrgAmtD / 100 | currency:""}}</td>
                </tr>

            </table>
            <div>
                经办：{{vm.pagination.list[0].dayBalanceReportDataList[0].busiHandler}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                复核：{{vm.pagination.list[0].dayBalanceReportDataList[0].busiAuditor}} &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                主管：{{vm.pagination.list[0].dayBalanceReportDataList[0].tasterMchnt}}
    </div>
    <core:import url="../common/pageFoot.jsp"/>
</div>
<core:import url="../common/nav.jsp"/>
</body>
</html>
